<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<div class="pageContent">
	<form method="post" action="${rootUrl}/goods/goods-attr-value<c:if test="${goodsAttrValue.id != 0 && goodsAttrValue.id != '' }">/${goodsAttrValue.id}</c:if>" class="pageForm required-validate" onsubmit="return beforeSubmit(this);">
		<c:if test="${goodsAttrValue.id != 0 && goodsAttrValue.id != '' }"><input type="hidden" name="_method" value="put"></c:if>
		<input type="hidden" name="goodsAttrValue.id" value="${goodsAttrValue.id }">
		<input type="hidden" name="goodsAttrValue.goodsId" value="${goodsAttrValue.goodsId }">
		<div class="pageFormContent" layoutH="56">
			<p>
				<label>属性名：</label>
				<input type="hidden" id="classId" name="goodsAttrValue.classId" value="${goodsAttrValue.attrClass.id }">
				<input type="hidden" id="classCode" name="goodsAttrValue.classCode" value="${goodsAttrValue.attrClass.code }">
				<input type="text" readonly="readonly" id="className" name="goodsAttrValue.className" class="required" size="30" value="${goodsAttrValue.attrClass.name }" />
				<a class="btnLook" href="${rootUrl}/goods/attr-class/0/dialog" width="1200" height="720" lookupGroup="goodsAttrValue">属性</a>
			</p>
			<p>
				<label>属性值：</label>
				<input type="hidden" id="valueId" name="goodsAttrValue.valueId" value="${goodsAttrValue.attrValue.id }">
				<input name="goodsAttrValue.valueName" id="valueName" class="required" type="text" size="30" value="${goodsAttrValue.attrValueName }" />
			</p>
   		 </div>
    	<div class="formBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button id="theSubmit" type="submit">保存</button></div></div></li>
				<li>
					<div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div>
				</li>
			</ul>
		</div>
    </form>
    	
</div>
<script>
	function beforeSubmit(obj){
		$("#classId").attr("name","goodsAttrValue.attrClass.id");
		$("#classCode").attr("name","goodsAttrValue.attrClassCode");
		$("#className").attr("name","goodsAttrValue.attrClassName");
		
		$("#valueId").attr("name","goodsAttrValue.attrValue.id");
		$("#valueName").attr("name","goodsAttrValue.attrValueName");
		return validateCallback(obj, _afterAjaxDone);
	}
	function _afterAjaxDone(json){
		$("#classId").attr("name","goodsAttrValue.classId");
		$("#classCode").attr("name","goodsAttrValue.classCode");
		$("#className").attr("name","goodsAttrValue.className");
		
		$("#valueId").attr("name","goodsAttrValue.valueId");
		$("#valueName").attr("name","goodsAttrValue.valueName");
		newDialogAjaxDone(json);
	}
</script>